package org.qiyu.live.id.generate.provider.service.bo;

import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * @Author idea
 * @Date: Created in 15:49 2025/1/27
 * @Description :无序id的bo对象
 */
public class LocalUnSeqIdBO {

    //mysql配置的id
    private Integer id;

    //提前将无序的id用队列存储起来，每取出一个，数量少一个，放入元素前要先打乱
    private ConcurrentLinkedQueue<Long> idQueue;

    //本地内存记录id段的开始位置
    private Long currentStart;

    //本地内存记录id段的结束位置
    private Long nextThreshold;

    public ConcurrentLinkedQueue<Long> getIdQueue() {
        return idQueue;
    }

    public void setIdQueue(ConcurrentLinkedQueue<Long> idQueue) {
        this.idQueue = idQueue;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Long getCurrentStart() {
        return currentStart;
    }

    public void setCurrentStart(Long currentStart) {
        this.currentStart = currentStart;
    }

    public Long getNextThreshold() {
        return nextThreshold;
    }

    public void setNextThreshold(Long nextThreshold) {
        this.nextThreshold = nextThreshold;
    }

    @Override
    public String toString() {
        return "LocalSeqIdBO{" +
                "id=" + id +
                ", currentStart=" + currentStart +
                ", nextThreshold=" + nextThreshold +
                '}';
    }
}
